package com.yang.dao;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.yang.entity.Mini;
import com.yang.util.DBHelp;
import com.yang.util.MapRow;

public class MiniDao {

	private DBHelp<Mini> dh=new DBHelp<Mini>();
	public String getMiniTye(String extension){
		String sql="SELECT * FROM t_mini WHERE extension=?";
		MapRow<Mini> mr=new MapRow<Mini>() {
			
			@Override
			public Mini RowMap(ResultSet rs) throws SQLException {
				Mini m=new Mini();
				m.setId(rs.getInt("id"));
				m.setExtension(rs.getString("extension"));
				m.setMiniType(rs.getString("miniType"));
				return m;
			}
		};
		Mini m=dh.findObj(sql, mr, extension);
		if(m==null){
			return "";
		}
		return m.getMiniType();
	}
}
